(0) Obligation:
Runtime Complexity TRS:
The TRS R consists of the following rules:
plus(0, x) → x
plus(s(x), y) → s(plus(p(s(x)), y))
times(0, y) → 0
times(s(x), y) → plus(y, times(p(s(x)), y))
p(s(0)) → 0
p(s(s(x))) → s(p(s(x)))
fac(0, x) → x
fac(s(x), y) → fac(p(s(x)), times(s(x), y))
factorial(x) → fac(x, s(0))
Rewrite Strategy: FULL
(1) DecreasingLoopProof (EQUIVALENT transformation)
The following loop(s) give(s) rise to the lower bound Ω(n1):
The rewrite sequence
p(s(s(x))) →+ s(p(s(x)))
gives rise to a decreasing loop by considering the right hand sides subterm at position [0].
The pumping substitution is [x / s(x)].
The result substitution is [ ].
(2) BOUNDS(n^1, INF)
(3) RenamingProof (EQUIVALENT transformation)
Renamed function symbols to avoid clashes with predefined symbol.
(4) Obligation:
Runtime Complexity Relative TRS:
The TRS R consists of the following rules:
plus(0', x) → x
plus(s(x), y) → s(plus(p(s(x)), y))
times(0', y) → 0'
times(s(x), y) → plus(y, times(p(s(x)), y))
p(s(0')) → 0'
p(s(s(x))) → s(p(s(x)))
fac(0', x) → x
fac(s(x), y) → fac(p(s(x)), times(s(x), y))
factorial(x) → fac(x, s(0'))
S is empty.
Rewrite Strategy: FULL
(5) TypeInferenceProof (BOTH BOUNDS(ID, ID) transformation)
Infered types.
(6) Obligation:
TRS:
Rules:
plus(0', x) → x
plus(s(x), y) → s(plus(p(s(x)), y))
times(0', y) → 0'
times(s(x), y) → plus(y, times(p(s(x)), y))
p(s(0')) → 0'
p(s(s(x))) → s(p(s(x)))
fac(0', x) → x
fac(s(x), y) → fac(p(s(x)), times(s(x), y))
factorial(x) → fac(x, s(0'))
Types:
plus :: 0':s → 0':s → 0':s
0' :: 0':s
s :: 0':s → 0':s
p :: 0':s → 0':s
times :: 0':s → 0':s → 0':s
fac :: 0':s → 0':s → 0':s
factorial :: 0':s → 0':s
hole_0':s1_0 :: 0':s
gen_0':s2_0 :: Nat → 0':s
(7) OrderProof (LOWER BOUND(ID) transformation)
Heuristically decided to analyse the following defined symbols:
plus,
p,
times,
facThey will be analysed ascendingly in the following order:
p < plus
plus < times
p < times
p < fac
times < fac
(8) Obligation:
TRS:
Rules:
plus(
0',
x) →
xplus(
s(
x),
y) →
s(
plus(
p(
s(
x)),
y))
times(
0',
y) →
0'times(
s(
x),
y) →
plus(
y,
times(
p(
s(
x)),
y))
p(
s(
0')) →
0'p(
s(
s(
x))) →
s(
p(
s(
x)))
fac(
0',
x) →
xfac(
s(
x),
y) →
fac(
p(
s(
x)),
times(
s(
x),
y))
factorial(
x) →
fac(
x,
s(
0'))
Types:
plus :: 0':s → 0':s → 0':s
0' :: 0':s
s :: 0':s → 0':s
p :: 0':s → 0':s
times :: 0':s → 0':s → 0':s
fac :: 0':s → 0':s → 0':s
factorial :: 0':s → 0':s
hole_0':s1_0 :: 0':s
gen_0':s2_0 :: Nat → 0':s
Generator Equations:
gen_0':s2_0(0) ⇔ 0'
gen_0':s2_0(+(x, 1)) ⇔ s(gen_0':s2_0(x))
The following defined symbols remain to be analysed:
p, plus, times, fac
They will be analysed ascendingly in the following order:
p < plus
plus < times
p < times
p < fac
times < fac
(9) RewriteLemmaProof (LOWER BOUND(ID) transformation)
Proved the following rewrite lemma:
p(
gen_0':s2_0(
+(
1,
n4_0))) →
gen_0':s2_0(
n4_0), rt ∈ Ω(1 + n4
0)
Induction Base:
p(gen_0':s2_0(+(1, 0))) →RΩ(1)
0'
Induction Step:
p(gen_0':s2_0(+(1, +(n4_0, 1)))) →RΩ(1)
s(p(s(gen_0':s2_0(n4_0)))) →IH
s(gen_0':s2_0(c5_0))
We have rt ∈ Ω(n1) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n).
(10) Complex Obligation (BEST)
(11) Obligation:
TRS:
Rules:
plus(
0',
x) →
xplus(
s(
x),
y) →
s(
plus(
p(
s(
x)),
y))
times(
0',
y) →
0'times(
s(
x),
y) →
plus(
y,
times(
p(
s(
x)),
y))
p(
s(
0')) →
0'p(
s(
s(
x))) →
s(
p(
s(
x)))
fac(
0',
x) →
xfac(
s(
x),
y) →
fac(
p(
s(
x)),
times(
s(
x),
y))
factorial(
x) →
fac(
x,
s(
0'))
Types:
plus :: 0':s → 0':s → 0':s
0' :: 0':s
s :: 0':s → 0':s
p :: 0':s → 0':s
times :: 0':s → 0':s → 0':s
fac :: 0':s → 0':s → 0':s
factorial :: 0':s → 0':s
hole_0':s1_0 :: 0':s
gen_0':s2_0 :: Nat → 0':s
Lemmas:
p(gen_0':s2_0(+(1, n4_0))) → gen_0':s2_0(n4_0), rt ∈ Ω(1 + n40)
Generator Equations:
gen_0':s2_0(0) ⇔ 0'
gen_0':s2_0(+(x, 1)) ⇔ s(gen_0':s2_0(x))
The following defined symbols remain to be analysed:
plus, times, fac
They will be analysed ascendingly in the following order:
plus < times
times < fac
(12) RewriteLemmaProof (LOWER BOUND(ID) transformation)
Proved the following rewrite lemma:
plus(
gen_0':s2_0(
n193_0),
gen_0':s2_0(
b)) →
gen_0':s2_0(
+(
n193_0,
b)), rt ∈ Ω(1 + n193
0 + n193
02)
Induction Base:
plus(gen_0':s2_0(0), gen_0':s2_0(b)) →RΩ(1)
gen_0':s2_0(b)
Induction Step:
plus(gen_0':s2_0(+(n193_0, 1)), gen_0':s2_0(b)) →RΩ(1)
s(plus(p(s(gen_0':s2_0(n193_0))), gen_0':s2_0(b))) →LΩ(1 + n1930)
s(plus(gen_0':s2_0(n193_0), gen_0':s2_0(b))) →IH
s(gen_0':s2_0(+(b, c194_0)))
We have rt ∈ Ω(n2) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n2).
(13) Complex Obligation (BEST)
(14) Obligation:
TRS:
Rules:
plus(
0',
x) →
xplus(
s(
x),
y) →
s(
plus(
p(
s(
x)),
y))
times(
0',
y) →
0'times(
s(
x),
y) →
plus(
y,
times(
p(
s(
x)),
y))
p(
s(
0')) →
0'p(
s(
s(
x))) →
s(
p(
s(
x)))
fac(
0',
x) →
xfac(
s(
x),
y) →
fac(
p(
s(
x)),
times(
s(
x),
y))
factorial(
x) →
fac(
x,
s(
0'))
Types:
plus :: 0':s → 0':s → 0':s
0' :: 0':s
s :: 0':s → 0':s
p :: 0':s → 0':s
times :: 0':s → 0':s → 0':s
fac :: 0':s → 0':s → 0':s
factorial :: 0':s → 0':s
hole_0':s1_0 :: 0':s
gen_0':s2_0 :: Nat → 0':s
Lemmas:
p(gen_0':s2_0(+(1, n4_0))) → gen_0':s2_0(n4_0), rt ∈ Ω(1 + n40)
plus(gen_0':s2_0(n193_0), gen_0':s2_0(b)) → gen_0':s2_0(+(n193_0, b)), rt ∈ Ω(1 + n1930 + n19302)
Generator Equations:
gen_0':s2_0(0) ⇔ 0'
gen_0':s2_0(+(x, 1)) ⇔ s(gen_0':s2_0(x))
The following defined symbols remain to be analysed:
times, fac
They will be analysed ascendingly in the following order:
times < fac
(15) RewriteLemmaProof (LOWER BOUND(ID) transformation)
Proved the following rewrite lemma:
times(
gen_0':s2_0(
n579_0),
gen_0':s2_0(
b)) →
gen_0':s2_0(
*(
n579_0,
b)), rt ∈ Ω(1 + b·n579
0 + b
2·n579
0 + n579
0 + n579
02)
Induction Base:
times(gen_0':s2_0(0), gen_0':s2_0(b)) →RΩ(1)
0'
Induction Step:
times(gen_0':s2_0(+(n579_0, 1)), gen_0':s2_0(b)) →RΩ(1)
plus(gen_0':s2_0(b), times(p(s(gen_0':s2_0(n579_0))), gen_0':s2_0(b))) →LΩ(1 + n5790)
plus(gen_0':s2_0(b), times(gen_0':s2_0(n579_0), gen_0':s2_0(b))) →IH
plus(gen_0':s2_0(b), gen_0':s2_0(*(c580_0, b))) →LΩ(1 + b + b2)
gen_0':s2_0(+(b, *(n579_0, b)))
We have rt ∈ Ω(n3) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n3).
(16) Complex Obligation (BEST)
(17) Obligation:
TRS:
Rules:
plus(
0',
x) →
xplus(
s(
x),
y) →
s(
plus(
p(
s(
x)),
y))
times(
0',
y) →
0'times(
s(
x),
y) →
plus(
y,
times(
p(
s(
x)),
y))
p(
s(
0')) →
0'p(
s(
s(
x))) →
s(
p(
s(
x)))
fac(
0',
x) →
xfac(
s(
x),
y) →
fac(
p(
s(
x)),
times(
s(
x),
y))
factorial(
x) →
fac(
x,
s(
0'))
Types:
plus :: 0':s → 0':s → 0':s
0' :: 0':s
s :: 0':s → 0':s
p :: 0':s → 0':s
times :: 0':s → 0':s → 0':s
fac :: 0':s → 0':s → 0':s
factorial :: 0':s → 0':s
hole_0':s1_0 :: 0':s
gen_0':s2_0 :: Nat → 0':s
Lemmas:
p(gen_0':s2_0(+(1, n4_0))) → gen_0':s2_0(n4_0), rt ∈ Ω(1 + n40)
plus(gen_0':s2_0(n193_0), gen_0':s2_0(b)) → gen_0':s2_0(+(n193_0, b)), rt ∈ Ω(1 + n1930 + n19302)
times(gen_0':s2_0(n579_0), gen_0':s2_0(b)) → gen_0':s2_0(*(n579_0, b)), rt ∈ Ω(1 + b·n5790 + b2·n5790 + n5790 + n57902)
Generator Equations:
gen_0':s2_0(0) ⇔ 0'
gen_0':s2_0(+(x, 1)) ⇔ s(gen_0':s2_0(x))
The following defined symbols remain to be analysed:
fac
(18) RewriteLemmaProof (LOWER BOUND(ID) transformation)
Proved the following rewrite lemma:
fac(
gen_0':s2_0(
n1124_0),
gen_0':s2_0(
b)) →
*3_0, rt ∈ Ω(b·n1124
0 + b·n1124
02 + b
2·n1124
0 + b
2·n1124
02 + n1124
0 + n1124
02 + n1124
03)
Induction Base:
fac(gen_0':s2_0(0), gen_0':s2_0(b))
Induction Step:
fac(gen_0':s2_0(+(n1124_0, 1)), gen_0':s2_0(b)) →RΩ(1)
fac(p(s(gen_0':s2_0(n1124_0))), times(s(gen_0':s2_0(n1124_0)), gen_0':s2_0(b))) →LΩ(1 + n11240)
fac(gen_0':s2_0(n1124_0), times(s(gen_0':s2_0(n1124_0)), gen_0':s2_0(b))) →LΩ(3 + b + b·n11240 + b2 + b2·n11240 + 3·n11240 + n112402)
fac(gen_0':s2_0(n1124_0), gen_0':s2_0(*(+(n1124_0, 1), b))) →IH
*3_0
We have rt ∈ Ω(n4) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n4).
(19) Complex Obligation (BEST)
(20) Obligation:
TRS:
Rules:
plus(
0',
x) →
xplus(
s(
x),
y) →
s(
plus(
p(
s(
x)),
y))
times(
0',
y) →
0'times(
s(
x),
y) →
plus(
y,
times(
p(
s(
x)),
y))
p(
s(
0')) →
0'p(
s(
s(
x))) →
s(
p(
s(
x)))
fac(
0',
x) →
xfac(
s(
x),
y) →
fac(
p(
s(
x)),
times(
s(
x),
y))
factorial(
x) →
fac(
x,
s(
0'))
Types:
plus :: 0':s → 0':s → 0':s
0' :: 0':s
s :: 0':s → 0':s
p :: 0':s → 0':s
times :: 0':s → 0':s → 0':s
fac :: 0':s → 0':s → 0':s
factorial :: 0':s → 0':s
hole_0':s1_0 :: 0':s
gen_0':s2_0 :: Nat → 0':s
Lemmas:
p(gen_0':s2_0(+(1, n4_0))) → gen_0':s2_0(n4_0), rt ∈ Ω(1 + n40)
plus(gen_0':s2_0(n193_0), gen_0':s2_0(b)) → gen_0':s2_0(+(n193_0, b)), rt ∈ Ω(1 + n1930 + n19302)
times(gen_0':s2_0(n579_0), gen_0':s2_0(b)) → gen_0':s2_0(*(n579_0, b)), rt ∈ Ω(1 + b·n5790 + b2·n5790 + n5790 + n57902)
fac(gen_0':s2_0(n1124_0), gen_0':s2_0(b)) → *3_0, rt ∈ Ω(b·n11240 + b·n112402 + b2·n11240 + b2·n112402 + n11240 + n112402 + n112403)
Generator Equations:
gen_0':s2_0(0) ⇔ 0'
gen_0':s2_0(+(x, 1)) ⇔ s(gen_0':s2_0(x))
No more defined symbols left to analyse.
(21) LowerBoundsProof (EQUIVALENT transformation)
The lowerbound Ω(n4) was proven with the following lemma:
fac(gen_0':s2_0(n1124_0), gen_0':s2_0(b)) → *3_0, rt ∈ Ω(b·n11240 + b·n112402 + b2·n11240 + b2·n112402 + n11240 + n112402 + n112403)
(22) BOUNDS(n^4, INF)
(23) Obligation:
TRS:
Rules:
plus(
0',
x) →
xplus(
s(
x),
y) →
s(
plus(
p(
s(
x)),
y))
times(
0',
y) →
0'times(
s(
x),
y) →
plus(
y,
times(
p(
s(
x)),
y))
p(
s(
0')) →
0'p(
s(
s(
x))) →
s(
p(
s(
x)))
fac(
0',
x) →
xfac(
s(
x),
y) →
fac(
p(
s(
x)),
times(
s(
x),
y))
factorial(
x) →
fac(
x,
s(
0'))
Types:
plus :: 0':s → 0':s → 0':s
0' :: 0':s
s :: 0':s → 0':s
p :: 0':s → 0':s
times :: 0':s → 0':s → 0':s
fac :: 0':s → 0':s → 0':s
factorial :: 0':s → 0':s
hole_0':s1_0 :: 0':s
gen_0':s2_0 :: Nat → 0':s
Lemmas:
p(gen_0':s2_0(+(1, n4_0))) → gen_0':s2_0(n4_0), rt ∈ Ω(1 + n40)
plus(gen_0':s2_0(n193_0), gen_0':s2_0(b)) → gen_0':s2_0(+(n193_0, b)), rt ∈ Ω(1 + n1930 + n19302)
times(gen_0':s2_0(n579_0), gen_0':s2_0(b)) → gen_0':s2_0(*(n579_0, b)), rt ∈ Ω(1 + b·n5790 + b2·n5790 + n5790 + n57902)
fac(gen_0':s2_0(n1124_0), gen_0':s2_0(b)) → *3_0, rt ∈ Ω(b·n11240 + b·n112402 + b2·n11240 + b2·n112402 + n11240 + n112402 + n112403)
Generator Equations:
gen_0':s2_0(0) ⇔ 0'
gen_0':s2_0(+(x, 1)) ⇔ s(gen_0':s2_0(x))
No more defined symbols left to analyse.
(24) LowerBoundsProof (EQUIVALENT transformation)
The lowerbound Ω(n4) was proven with the following lemma:
fac(gen_0':s2_0(n1124_0), gen_0':s2_0(b)) → *3_0, rt ∈ Ω(b·n11240 + b·n112402 + b2·n11240 + b2·n112402 + n11240 + n112402 + n112403)
(25) BOUNDS(n^4, INF)
(26) Obligation:
TRS:
Rules:
plus(
0',
x) →
xplus(
s(
x),
y) →
s(
plus(
p(
s(
x)),
y))
times(
0',
y) →
0'times(
s(
x),
y) →
plus(
y,
times(
p(
s(
x)),
y))
p(
s(
0')) →
0'p(
s(
s(
x))) →
s(
p(
s(
x)))
fac(
0',
x) →
xfac(
s(
x),
y) →
fac(
p(
s(
x)),
times(
s(
x),
y))
factorial(
x) →
fac(
x,
s(
0'))
Types:
plus :: 0':s → 0':s → 0':s
0' :: 0':s
s :: 0':s → 0':s
p :: 0':s → 0':s
times :: 0':s → 0':s → 0':s
fac :: 0':s → 0':s → 0':s
factorial :: 0':s → 0':s
hole_0':s1_0 :: 0':s
gen_0':s2_0 :: Nat → 0':s
Lemmas:
p(gen_0':s2_0(+(1, n4_0))) → gen_0':s2_0(n4_0), rt ∈ Ω(1 + n40)
plus(gen_0':s2_0(n193_0), gen_0':s2_0(b)) → gen_0':s2_0(+(n193_0, b)), rt ∈ Ω(1 + n1930 + n19302)
times(gen_0':s2_0(n579_0), gen_0':s2_0(b)) → gen_0':s2_0(*(n579_0, b)), rt ∈ Ω(1 + b·n5790 + b2·n5790 + n5790 + n57902)
Generator Equations:
gen_0':s2_0(0) ⇔ 0'
gen_0':s2_0(+(x, 1)) ⇔ s(gen_0':s2_0(x))
No more defined symbols left to analyse.
(27) LowerBoundsProof (EQUIVALENT transformation)
The lowerbound Ω(n3) was proven with the following lemma:
times(gen_0':s2_0(n579_0), gen_0':s2_0(b)) → gen_0':s2_0(*(n579_0, b)), rt ∈ Ω(1 + b·n5790 + b2·n5790 + n5790 + n57902)
(28) BOUNDS(n^3, INF)
(29) Obligation:
TRS:
Rules:
plus(
0',
x) →
xplus(
s(
x),
y) →
s(
plus(
p(
s(
x)),
y))
times(
0',
y) →
0'times(
s(
x),
y) →
plus(
y,
times(
p(
s(
x)),
y))
p(
s(
0')) →
0'p(
s(
s(
x))) →
s(
p(
s(
x)))
fac(
0',
x) →
xfac(
s(
x),
y) →
fac(
p(
s(
x)),
times(
s(
x),
y))
factorial(
x) →
fac(
x,
s(
0'))
Types:
plus :: 0':s → 0':s → 0':s
0' :: 0':s
s :: 0':s → 0':s
p :: 0':s → 0':s
times :: 0':s → 0':s → 0':s
fac :: 0':s → 0':s → 0':s
factorial :: 0':s → 0':s
hole_0':s1_0 :: 0':s
gen_0':s2_0 :: Nat → 0':s
Lemmas:
p(gen_0':s2_0(+(1, n4_0))) → gen_0':s2_0(n4_0), rt ∈ Ω(1 + n40)
plus(gen_0':s2_0(n193_0), gen_0':s2_0(b)) → gen_0':s2_0(+(n193_0, b)), rt ∈ Ω(1 + n1930 + n19302)
Generator Equations:
gen_0':s2_0(0) ⇔ 0'
gen_0':s2_0(+(x, 1)) ⇔ s(gen_0':s2_0(x))
No more defined symbols left to analyse.
(30) LowerBoundsProof (EQUIVALENT transformation)
The lowerbound Ω(n2) was proven with the following lemma:
plus(gen_0':s2_0(n193_0), gen_0':s2_0(b)) → gen_0':s2_0(+(n193_0, b)), rt ∈ Ω(1 + n1930 + n19302)
(31) BOUNDS(n^2, INF)
(32) Obligation:
TRS:
Rules:
plus(
0',
x) →
xplus(
s(
x),
y) →
s(
plus(
p(
s(
x)),
y))
times(
0',
y) →
0'times(
s(
x),
y) →
plus(
y,
times(
p(
s(
x)),
y))
p(
s(
0')) →
0'p(
s(
s(
x))) →
s(
p(
s(
x)))
fac(
0',
x) →
xfac(
s(
x),
y) →
fac(
p(
s(
x)),
times(
s(
x),
y))
factorial(
x) →
fac(
x,
s(
0'))
Types:
plus :: 0':s → 0':s → 0':s
0' :: 0':s
s :: 0':s → 0':s
p :: 0':s → 0':s
times :: 0':s → 0':s → 0':s
fac :: 0':s → 0':s → 0':s
factorial :: 0':s → 0':s
hole_0':s1_0 :: 0':s
gen_0':s2_0 :: Nat → 0':s
Lemmas:
p(gen_0':s2_0(+(1, n4_0))) → gen_0':s2_0(n4_0), rt ∈ Ω(1 + n40)
Generator Equations:
gen_0':s2_0(0) ⇔ 0'
gen_0':s2_0(+(x, 1)) ⇔ s(gen_0':s2_0(x))
No more defined symbols left to analyse.
(33) LowerBoundsProof (EQUIVALENT transformation)
The lowerbound Ω(n1) was proven with the following lemma:
p(gen_0':s2_0(+(1, n4_0))) → gen_0':s2_0(n4_0), rt ∈ Ω(1 + n40)
(34) BOUNDS(n^1, INF)